package oop3.exer1;

/**
 * Created with IntelliJ IDEA.
 * ClassName: Account
 * Package: oop3.exer1
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-11-23
 * Time: 16:28
 */

//账号类
public class Account {

    private int id; //账号
    private String password; //密码
    private double balance; //余额
    private static double interestRate;//利率

    private static double minBalance;//最小余额

    public Account() {
        //Id自动生成 定义全局一份的静态变量
        this.id = init;
        init++;
    }
    private static int init = 1001;

    public Account(String password, double balance) {
        this.password = password;
        this.balance = balance;
        this.id = init;
        init++;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public static double getInterestRate() {
        return interestRate;
    }

    public static void setInterestRate(double interestRate) {
        Account.interestRate = interestRate;
    }

    public static double getMinBalance() {
        return minBalance;
    }

    public static void setMinBalance(double minBalance) {
        Account.minBalance = minBalance;
    }

    @Override
    public String toString() {
        return "Account{" +
                "id=" + id +
                ", password='" + password + '\'' +
                ", balance=" + balance +
                '}';
    }
}
